package com.xiaoxu.flow;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class FlowPartitioner extends Partitioner<Text, FlowEntity> {
    @Override
    public int getPartition(Text text, FlowEntity flowEntity, int numPartitions) {
        if (text.toString().startsWith("13")) {
            return 0;
        } else if (text.toString().startsWith("15")) {
            return 1;
        } else {
            return 2;
        }
    }
}
